import { createBrowserRouter, Navigate } from 'react-router-dom';
import App from '../App';
import Home from '../components/Home';
import Index from '../components/Index';
import List from '../components/List';

export const router = createBrowserRouter([
    {
        path: '/',
        element: <App></App>,
        children: [
            {
                path: '/home',
                element: <Home></Home>,
                children: [
                    {
                        path: '/home/index',
                        element: <Index></Index>
                    },
                    {
                        path: '/home/list',
                        element: <List></List>
                    },
                    {
                        path: '/home',
                        element: <Navigate to='/home/list'></Navigate>
                    },
                ]
            },
            {
                path: '/',
                element: <Navigate to='/home'></Navigate>
            },
        ]
    },
]);